<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.FileReader" %>
<%@ page import="database.*" %>
<%@ page import="servlet.ArticleType" %>
<%@ page import="java.util.List" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>清风品道</title>
<script type="text/javascript" language="JavaScript">
	function setStyle() {
		document.getElementById("navIndex").style.color="#CC0000";
		document.getElementById("navIndex").style.background="url(./image/nav.jpg) no-repeat 0px -20px";
	}

	function setImage(n) {
		switch(n) {
		case 1:
			document.getElementById("img").src="./image/1.jpg";
			break;
		case 2:
			document.getElementById("img").src="./image/2.jpg";
			break;
		case 3:
			document.getElementById("img").src="./image/3.jpg";
			break;
		case 4:
			document.getElementById("img").src="./image/4.jpg";
			break;
		case 5:
			document.getElementById("img").src="./image/5.jpg";
			break;
		}
	}
</script>
<style type="text/css">
span {
color: white; 
background-color: gray;
}
span:hover {
background: #f4a460;
}
</style>
</head>
<body onload="setStyle()">

<jsp:include page="./nav.jsp"></jsp:include>

<table align="center" width="900px">
	<tr valign="top">
		<td width="300px">
			<div style="height:200px; text-align:left">
				<p style="font-size:20px; font-family:隶书; background-color:#ffa500">&nbsp;赛事活动</p>
				<ul>
				<%
				int belongTo = ArticleType.MATCH.getBelongTo();
				List<Article> list = DatabaseManager.articleQueryByBelongTo(belongTo);
				int i = 0;
				for(Article article : list) {
					i++;
					if(i>8) {
						break;
					}
				%>
					<li><a href="./article.jsp?articleID=<%=article.getArticleID() %>" style="text-decoration:none;"><%=article.getTitle() %></a></li>
				<%} %>
				</ul>
			</div>
		</td>
		<td colspan="2">
			<div style="height:300px">
				<img id="img" src="./image/1.jpg" alt="" width="600px" height="300px" />
			</div>
		</td>
	</tr>
	<tr>
		<td></td>
		<td colspan="2" align="right">
			<span onmouseover="setImage(1)">&nbsp;1&nbsp;</span>
			<span onmouseover="setImage(2)">&nbsp;2&nbsp;</span>
			<span onmouseover="setImage(3)">&nbsp;3&nbsp;</span>
			<span onmouseover="setImage(4)">&nbsp;4&nbsp;</span>
			<span onmouseover="setImage(5)">&nbsp;5&nbsp;</span>
		</td>
	</tr>
	<tr valign="top">
		<td width="300px">
			<div style="height:200px; text-align:left">
				<p style="font-size:20px; font-family:隶书; background-color:#ffa500">&nbsp;企业动态</p>
				<ul>
				<%
				belongTo = ArticleType.TRENDS.getBelongTo();
				list = DatabaseManager.articleQueryByBelongTo(belongTo);
				i = 0;
				for(Article article : list) {
					i++;
					if(i>5) {
						break;
					}
				%>
					<li><a href="./article.jsp?articleID=<%=article.getArticleID() %>" style="text-decoration:none"><%=article.getTitle() %></a></li>
				<%} %>
				</ul>
			</div>
		</td>
		<td width="300px">
			<div style="height:200px; text-align:left">
				<p style="font-size:20px; font-family:隶书; background-color:#ffa500">&nbsp;媒体报道</p>
				<ul>
				<%
				belongTo = ArticleType.NEWS.getBelongTo();
				list = DatabaseManager.articleQueryByBelongTo(belongTo);
				i = 0;
				for(Article article : list) {
					i++;
					if(i>5) {
						break;
					}
				%>
					<li><a href="./article.jsp?articleID=<%=article.getArticleID() %>" style="text-decoration:none"><%=article.getTitle() %></a></li>
				<%} %>
				</ul>
			</div>
		</td>
		<td width="300px">
			<div style="height:200px; text-align:left">
				<p style="font-size:20px; font-family:隶书; background-color:#ffa500">&nbsp;亲子乐园</p>
				<ul>
				<%
				belongTo = ArticleType.PARADISE.getBelongTo();
				list = DatabaseManager.articleQueryByBelongTo(belongTo);
				i = 0;
				for(Article article : list) {
					i++;
					if(i>5) {
						break;
					}
				%>
					<li><a href="./article.jsp?articleID=<%=article.getArticleID() %>" style="text-decoration:none"><%=article.getTitle() %></a></li>
				<%} %>
				</ul>
			</div>
		</td>
	</tr>
</table>

<jsp:include page="./bottom.jsp"></jsp:include>
</body>
</html>